from appium.webdriver.common.appiumby import AppiumBy

from app_practice.app_wework_po.frame.base_page import BasePage


class EditMemberPage(BasePage):
    _INPUT_USERNAME = AppiumBy.XPATH, "//*[contains(@text, '姓名')]/../*[@text='必填']"
    _INPUT_PHONE = (AppiumBy.XPATH, "//*[contains(@text, '手机')]/..//*[@text='必填']")
    _BNT_SAVE = (AppiumBy.XPATH, "//*[@text='保存']")
    """编辑成员页"""
    def fill_info(self,name,phone_num):
        """填写 姓名，手机号，点击保存"""
        # 输入【姓名】【手机号】并点击【保存
        self.find_and_send(name, *self._INPUT_USERNAME)
        self.find_and_send(phone_num, *self._INPUT_PHONE)
        self.find_and_click(self._BNT_SAVE)
        from app_practice.app_wework_po.page.add_member_page import AddMemberPage
        return AddMemberPage(self.driver)